from PySide6.QtWidgets import QMainWindow, QMessageBox
import subprocess
import os

class AppController:
    def __init__(self, view: QMainWindow):
        self.view = view
        
    def show_about(self):
        msg_box = QMessageBox()
        msg_box.setIconPixmap(QPixmap('resources/about_icon.png'))
        msg_box.setText("这是关于信息\n更多详情请访问：www.baidu.com")
        msg_box.exec_()

    def change_theme(self):
        # 实现更改主题的功能
        pass

    def run_sub_app(self, app_name):
        script_path = f'sub_apps/{app_name}.py'
        if os.path.exists(script_path):
            subprocess.Popen(['python', script_path])
        else:
            print(f"Script not found: {script_path}")

    def show_future_feature_message(self):
        msg_box = QMessageBox()
        msg_box.setText("<blink>更多功能正在开发中，敬请期待！</blink>")
        msg_box.exec_()